<template>
  <div class="app-container">
    <case-log ref="caseLog"></case-log>
  </div>
</template>
<script>
import { mapGetters } from 'vuex';
import caseLog from '@/views/log/caseLog';
export default {
  components: {
    caseLog
  },
  data() {
    return {
      list: [
        { code: 'logs:patient', name: '患者日志' },
        { code: 'logs:case', name: '病例日志' },
        { code: 'logs:order', name: '订单日志' },
        { code: 'logs:login', name: '登录日志' }
      ]
    };
  },
  computed: {
    ...mapGetters(['searchInfo'])
  },
  watch: {
    searchInfo(newVal, oldVal) {
      const { name } = this.list.filter(item => item.code === newVal.code)[0];
      this.$refs.caseLog.searchParams.logType = name;
      this.$refs.caseLog.toQuery();
    }
  },
  mounted() {
    console.log(this.searchInfo);
  },
  methods: {

  }
};
</script>
<style lang="scss" scoped>

</style>
